package com.yyplatform.frontend.infra.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.security.SecurityRequirement;

/**
 * Created on 2024-09-13
 */
@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI createRestApi() {
        return new OpenAPI()
                .info(apiInfo())
                .security(security());
    }

    private Info apiInfo() {
        return new Info()
                .title("yyplatform开发框架")
                .description("yyplatform开发框架_frontend_boot_api_接口文档")
                .version("v0.01");
    }

    private List<SecurityRequirement> security() {
        SecurityRequirement key = new SecurityRequirement();
//        key.addList(JwtShiroToken.JWT_TOKEN_NAME, JwtShiroToken.JWT_TOKEN_NAME);

        List<SecurityRequirement> list = new ArrayList<>();
        list.add(key);
        return list;
    }


}
